class MyTest:
    name=100
    age=99
    def __init__(self,a,b):
        self.a=a
        self.b=b

m=MyTest(11,22)
print(m.__dict__)
print(MyTest.__dict__)

class MyTest2:
    __slots__ = ['name','age']
    # 限制对象可以设置的属性

m2=MyTest2()
m2.name="zhansan"
print(m2.name)